<?php
return array(
	'basePath'						=> ROOT_PATH . '/protected',
	'name'							=> '人人有鱼',
	'language'						=> 'zh_cn',
	'timeZone'						=> 'Asia/Chongqing',
	'theme'							=> 'classic',

	'preload' 						=> array('log'),

	'import'						=> array(
		'ext.dataGrid.*',
		'ext.noticeServer.*',
		'application.mongo.*',
		'application.models.*',
		'application.components.*',
		'application.modules.srbac.controllers.SBaseController',
	),

	'modules'						=> array(
		'manage',					//后台管理
		'ycoe',						//
		'my',						//用户中心
		'gii'						=> array(
			'class'					=> 'system.gii.GiiModule',
			'password'				=> 'admin',
			'ipFilters'				=> array('127.0.0.1', '::1'),
		),
			
		'srbac' 					=> array(
			'userclass'				=> 'User',
			'userid'				=> 'id',
			'username'				=> 'name',
			'delimeter'				=> '@',
			'debug'					=> true,
			'pageSize'				=> 10,
			'superUser' 			=> 'Authority',
			'css'					=> 'srbac.css',
			'layout'				=> 'application.views.layouts.box_layout',
			'notAuthorizedView'		=> 'srbac.views.authitem.unauthorized',
			'alwaysAllowed'			=> array('SiteLogin'),
			'userActions'			=> array(),
			'listBoxNumberOfLines'	=> 15,
			'imagesPath' 			=> 'srbac.images',
			'imagesPack'			=> 'noia',
			'iconText'				=> true,
			'header'				=> 'srbac.views.authitem.header',
			'footer'				=> 'srbac.views.authitem.footer',
			'showHeader'			=> true,
			'showFooter'			=> true,
			'alwaysAllowedPath'		=> 'srbac.components',
		),
	),

	'components'					=> array(
		'user'						=> array(
			'allowAutoLogin'		=> true,
			'class' 				=> 'YWebUser',
			'loginUrl' 				=> '/Site/Login',
		),
		'urlManager'				=> array(
			'urlFormat' 			=> 'path',
			'showScriptName' 		=> false,
			'caseSensitive'			=> false,
			'urlSuffix' 			=> '.html',
			'rules'					=> array(
				'<controller:\w+>/<id:\d+>'								=> '<controller>/index',
				'<controller:\w+>/<id:\w{24}>'							=> '<controller>/index',//适配使用UUID的情况
				'<controller:\w+>/<action:\w+>/<id:(\d+|\w{24})>'		=> '<controller>/<action>',
				'<controller:\w+>/<action:\w+>'							=> '<controller>/<action>',
				'<module:\w+>/<controller:\w+>/<action:\w+>/<id:\w+>'	=> '<module>/<controller>/<action>', //适配使用UUID的情况
			),
		),
		'cache'						=> array(
			'class'					=> 'system.caching.CMemCache',
			'servers'				=> array(
				array(
					'host'			=> '127.0.0.1', 
					'port'			=> 11211, 
					'weight'		=> 100
				),
			),
		),
		'session' 					=> array(
            'class'					=> 'CCacheHttpSession',
            'cacheID' 				=> 'cache',
            'cookieMode' 			=> 'only',
            'sessionName'			=> 'YOUYU_ID',
            'timeout' 				=> 1200,
        ),
		'db'						=> array(
			'connectionString' 		=> 'mysql:host=127.0.0.1;dbname=duoec_shop',
			'emulatePrepare' 		=> true,
			'username' 				=> 'root',
			'password' 				=> 'root',
			'charset' 				=> 'utf8',
// 			'schemaCachingDuration'=>3600,//开启表结构缓存（schema caching）提高性能
		),
		'errorHandler'				=> array(
			'errorAction'			=> 'site/error',
		),
		'log'						=> array(
			'class'					=> 'CLogRouter',
			'routes'				=> array(
				array(
					'class'			=> 'CFileLogRoute',
					'levels'		=> 'error, warning',
				),
			),
		),
		'authManager'				=> array(
			'class'					=> 'application.modules.srbac.components.SDbAuthManager',
			'connectionID'			=> 'db',
			'itemTable'				=> 'auth_items',
			'assignmentTable'		=> 'auth_assignments',
			'itemChildTable'		=> 'auth_item_children',
		),
// 		'clientScript'=>array(
// 			'class'					=> 'ext.minScript.components.ExtMinScript',
// 			'minScriptControllerId'	=> 'min',
// 			'minScriptCacheId'		=> 'cache',
// 			'minScriptDebug'		=> false,
// 			'minScriptBaseUrl'		=> '',
// 			'minScriptLmCache'		=> 1000,
// 		),
	),
		
	'controllerMap'=>array(
		'min'						=> array(
			'class'					=> 'ext.minScript.controllers.ExtMinScriptController',
			'minScriptComponentId'	=> 'clientScript',
		),
	),

	'params'						=> array(
		'adminEmail'				=> 'ycoe12@gmail.com',
		'mongo'	 					=> 'mongodb://127.0.0.1:27017',
		'fingerprint'				=> 'DUOEC0802',			//密码指纹，用于用户密码加密
	),
);